import $req from './request';
/**
 * 手机号授权
 * @param data 请求参数
 */
export const getBindPhoneTypeApi = data => {
    $req({
        method: 'post',
        url: '/xcx/login/getBindRelationList',
        data,
    });
};
/**
 * 手机号获取用户身份
 * @param data 请求参数
 */
export const getAdminTypeByPhoneApi = (params: anyObj) => 
    $req({
        method: 'get',
        url: '/sysUser/getAdminTypeByPhone',
        params,
    });

/**
 * 发送验证码
 * @param data 请求参数
 */
export const sendCodeMessageApi = data => 
    $req({
        method: 'post',
        url: `/sms/sendMessage?phoneNumbers=${data}`,
    });

/**
 * 手机号验证码登录
 * @param data 请求参数
 */
export const smsLoginApi = data => 
    $req({
        method: 'post',
        url: '/smsLogin',
        data,
    });

/**
 * 获取用户信息
 * @param data 请求参数
 */
export const getUserInfoApi = () => 
    $req({
        method: 'get',
        url: '/sysUser/selectUser',
    });

/**
 * 授权用户绑定
 * @param data 请求参数
 */
export const bindAuthInfoApi = data => 
    $req({
        method: 'post',
        url: '/wechatPublic/bindAuthInfo',
        data,
    });
/**
 * 获取静默授权链接
 * @param data 请求参数
 */
export const getAuthUrlApi = () => 
    $req({
        method: 'get',
        url: '/wechatPublic/getAuthUrl',
    });

// 退出登录
export const logout = () =>
    $req({
        url: '/logout',
    });
